/**
 * Created by limeng on 16/8/31.
 */
indexApp.controller("MainContentCtrl", function ($scope, $http) {
    //初始化
    $scope.noticeList = [];
    $scope.knowledgeList = [];
    $scope.newProposalList = [];
    $scope.hotestProposalList = [];
    $scope.historyList = [];

    $(".nav_elem").removeClass("jc_li_selected");
    $("#nav_index").addClass("jc_li_selected");

    //获取通知公告列表
    $http.post('/article/search', {pageSize : 5, pageNo : 1, type : 0}).success(function (data) {
        if (data.state == true) {
            $scope.noticeList = data.list;
        }
    });

    //获取提案知识列表
    $http.post('/article/search', {pageSize : 5, pageNo : 1, type : 1}).success(function (data) {
        if (data.state == true) {
            $scope.knowledgeList = data.list;
        }
    });

    //获取最新提案列表
    $http.get('/proposal/newProposalList/5/1').success(function (data) {
        if (data.state == true) {
            $scope.newProposalList = data.list;
        }
    });

    //获取最火提案列表
    $http.get('/proposal/hotestProposalList/5/1').success(function (data) {
        if (data.state == true) {
            $scope.hotestProposalList = data.list;
        }
    });

    //获取历年提案
    $http.get('/systemConfig/history/5/1').success(function (data) {
        if (data.state == true) {
            $scope.historyList = data.list;
        }
    });

});